package com.tan.androidtest.java;

/**
 * 测试Thread的join()方法
 *
 */

public class TestThreadJoinMethod {

    public static void main(String[] args) {

        Thread thread = new Thread() {
            @Override
            public void run() {
                super.run();

                System.out.println("===--");
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        };


        thread.start();

        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("+++++++");

    }

}
